Sending Messages & Response Details
Message Lifecycle
| Step | Action |
|---|---|
| 1 | User submits text (or clicks a starter prompt) |
| 2 | UI immediately appends a user bubble (optimistic update) |
| 3 | Request sent to Chat API (POST /chat/send_message) with user token and active mode |
| 4 | Middleware validates the token |
| 5 | Backend orchestrates (MCP tool → LLM → internal Data Manager APIs) |
| 6 | Response returned with text (+ optional visualization payload) |
| 7 | Internal tool messages are filtered out — only user‑visible text is shown |
| 8 | UI renders sanitized markdown + chart (if any) & auto‑scrolls to bottom |
On the first message in a new conversation, the title is auto‑generated from the first six words of your message.
Tips for Effective Prompts
- Be explicit about the data entity (e.g., "Show account balances by account name")
- Ask for summaries or comparisons
- If you want a list, start with: "List ..."; bullet formatting will improve readability
- In Q&A mode, ask about platform features, configuration, or processes
Visualization Responses
Current implementation supports pie charts. A response qualifies when it includes:
{
"visualization_type": "pie",
"visualization_data": [
{ "account_name": "Operating", "available_balance": "12345.67" },
{ "account_name": "Reserves", "available_balance": "8901.23" }
]
}
Rules:
- Numeric values are parsed as floats
- Legend + percentage labels auto render
- Up to 5 default colors rotate
More chart types are planned (see Feature Flags section).
Error Handling
If a send fails you receive a notification: "Failed to send message. Please try again." The original input is cleared currently; you can retype / paste.
Sanitization & Allowed HTML
Before display, markup passes through a custom markdown-to-HTML simplifier then DOMPurify with a very small allow‑list to prevent script injection.